package com.fr.base.file;

import com.fr.base.FCloneable;
import com.fr.base.FRContext;
import com.fr.base.core.util.ListMap;
import com.fr.data.Dictionary;
import java.util.Iterator;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 * @deprecated
 */
public class DeprecatedDictionaryManager
{
  private ListMap nameDictionaryMap = new ListMap();

  public Iterator getDictionaryNameIterator()
  {
    return this.nameDictionaryMap.keySet().iterator();
  }

  private Dictionary getStoredDictionary(String paramString)
  {
    return ((Dictionary)this.nameDictionaryMap.get(paramString));
  }

  public Dictionary getDictionary(String paramString)
  {
    Dictionary localDictionary = getStoredDictionary(paramString);
    try
    {
      return ((localDictionary == null) ? null : (Dictionary)localDictionary.clone());
    }
    catch (CloneNotSupportedException localCloneNotSupportedException)
    {
      FRContext.getLogger().log(Level.WARNING, localCloneNotSupportedException.getMessage(), localCloneNotSupportedException);
    }
    return null;
  }

  public void putDictionary(String paramString, Dictionary paramDictionary)
  {
    if (paramDictionary == null)
      this.nameDictionaryMap.remove(paramString);
    this.nameDictionaryMap.put(paramString, paramDictionary);
  }

  public boolean renameDictionary(String paramString1, String paramString2)
  {
    if ((!(this.nameDictionaryMap.containsKey(paramString1))) || (this.nameDictionaryMap.containsKey(paramString2)))
      return false;
    int i = this.nameDictionaryMap.indexOf(paramString1);
    this.nameDictionaryMap.put(i, paramString2, this.nameDictionaryMap.get(paramString1));
    return true;
  }

  public void removeDictionary(String paramString)
  {
    this.nameDictionaryMap.remove(paramString);
  }

  public void clearAllDictionary()
  {
    this.nameDictionaryMap.clear();
  }
}